from untils.SendMethod import SendMethod


class DistinGuishedGuest:
    def __init__(self):
        self.url = "http://127.0.0.1:8000"

    # 添加嘉宾
    def add_guest(self, body):
        url = self.url + "/api/add_guest/"
        return SendMethod.send_method("post", url, data=body)

    # 查询嘉宾
    def get_guest(self, params):
        url = self.url + "/api/get_guest_list/"
        return SendMethod.send_method("get", url, params)

    # 嘉宾签到
    def user_sign(self, body):
        url = self.url + "/api/user_sign/"
        return SendMethod.send_method("post", url, data=body)


if __name__ == '__main__':
    body = {
        "eid": "7116523",
        "realname": "www1",
        "phone": "13956866468",
        "email": "23365@qq.com"
    }
    print(DistinGuishedGuest().add_guest(body))
    params = {
        "eid": "48263782",
        "phone": "13956866468"
    }
    print(DistinGuishedGuest().get_guest(params))
    data = {
        "eid": "7116523",
        "phone": "13956866468"
    }
    print(DistinGuishedGuest().user_sign(data))
